package com.software.loginregister.api;

import com.software.loginregister.entity.Result;
import com.software.loginregister.entity.Works;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface LikeApi {
    @POST("/api/likes/toggleLike")
    Call<Result<Map<String, Object>>> toggleLike(
            @Query("userId") Long userId,
            @Query("targetId") Long targetId,
            @Query("targetType") String targetType
    );
    @POST("/api/likes/recordHistory")
    Call<Result<Void>> recordBrowsingHistory(@Query("userId") Long userId, @Query("targetId") Long targetId);

    @GET("/api/likes/isLiked")
    Call<Result<Boolean>> isLiked(@Query("targetId") Long worksId, @Query("userId") Long userId, @Query("targetType") String targetType);

    @GET("/api/likes/browsingHistory")
    Call<Result<List<Works>>> getBrowsingHistory(@Query("userId") Long userId);

    @GET("/api/likes/count")
    Call<Result<Integer>> getLikeCount(@Query("targetId") Long targetId, @Query("targetType") String targetType);
}
